package com.demo.zhihu.model;

import org.apache.ibatis.type.Alias;

@Alias("Like")
public class Like {
	private int id;
	private int user;
	private int type;
	private int target;
	private boolean canceled;
	public Like(){};
	public Like(int user,int type,int target) {
		this.user = user;
		this.type = type;
		this.target = target;
	}
	public int getTarget() {
		return target;
	}
	public void setTarget(int target) {
		this.target = target;
	};
	
	public boolean isCanceled() {
		return canceled;
	}
	public void setCanceled(boolean canceled) {
		this.canceled = canceled;
	}
	
	public int getQty() {
		return canceled? -1:1;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getUser() {
		return user;
	}
	public void setUser(int user) {
		this.user = user;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
}
